#ifndef FLAPPYBIRD_H
#define FLAPPYBIRD_H

#include <QMainWindow>
#include <QKeyEvent>
#include <QPushButton>
#include <QPainter>
#include <QTime>
#include <QPoint>
#include <QSize>
#include <QDebug>
#include <QMessageBox>
#include <QRect>

namespace Ui {
class flappybird;
}

class bird
{
public:
    double x=200;
    double y=400;
    double v=0.9;
    double g=-0.0025;
    //bird的xy坐标/速度/加速度

};

class flappybird : public QMainWindow
{
    Q_OBJECT

public:
    explicit flappybird(QWidget *parent = 0);
    ~flappybird();
    void paintEvent(QPaintEvent *);
    void keyPressEvent(QKeyEvent *event);
    void display();
    void die();
    void setl();
    QPushButton *button;
    QPushButton *button2;
    QPushButton *button3;
    bird F;
    int time=0;
    int diecount=0;
    int count=0;
    double score=0;
    int scorecount=0;
    int h;
    double velocity=0.25;
    bool state=1;
    int start=0;

    QTime time1;
    QTime time2;
    QTime time3;
    QTime time4;
    QTime time5;
    //计时器

    double l1=1200;
    double l2=1600;
    double l3=2000;
    double l4=2400;
    //柱子的x坐标
    int hard=0;
    //难度系数
    double hardship=1;
    //难度分数加成
    int ran1[4];
    int ran2[4];
    //柱子高度的随机数

    double l5=3000;
    //宝石的x坐标
    double ranl5h=400;
    //宝石的y坐标
    int bscount=0;
    //宝石计数器

    double l6=4200;
    //钻石的x坐标
    double ranl6h=400;
    //钻石的y坐标
    int zscount=0;
    //钻石计数器

    double shield=0;
    double shieldtime=0;
    double shieldcd=0;
    double shieldcount1=0;
    double shieldcount2=0;
    double slow=0;
    double slowtime=0;
    double slowcd=0;
    double slowcount1=0;
    double slowcount2=0;


public slots:
    void slotStart();
    void slotStart2();
    void slotStart3();

private:
    Ui::flappybird *ui;
};


#endif // FLAPPYBIRD_H
